/*
** list_apply.c for liblist in /home/guina_b/
** 
** Made by benoit guina
** Login   <guina_b@epitech.net>
** 
** Started on  Fri Jan 01 00:00:00 2010 benoit guina
** Last update Fri Jan 01 00:00:00 2010 benoit guina
*/

#include "list.h"

void	list_apply(void *l, void (*f)(void *))
{
  void	*next;

  while (l)
    {
      next = *(void **)l;
      f(l);
      l = next;
    }
}

void	list_apply1(void *l, void (*f)(void *, void *p1), void *p1)
{
  void	*next;

  while (l)
    {
      next = *(void **)l;
      f(l, p1);
      l = next;
    }
}

void	list_apply2(void *l, void (*f)(void *, void *p1, void *p2),
		    void *p1, void *p2)
{
  void	*next;

  while (l)
    {
      next = *(void **)l;
      f(l, p1, p2);
      l = next;
    }
}
